package com.youyi.yypermissionlibrary.core.os;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;

public class Vivo implements SettingPage {
    private Context context;

    public Vivo(Context context2) {
        this.context = context2;
    }

    @Override // com.youyi.yypermissionlibrary.core.os.SettingPage
    public Intent createIntent() throws PackageManager.NameNotFoundException {
        Intent intent = new Intent();
        intent.putExtra("packageName", this.context.getPackageName());
        intent.putExtra(SettingPage.EXTRA_PKG_NAME, this.context.getPackageName());
        intent.putExtra(SettingPage.EXTRA_PKG, this.context.getPackageName());
        intent.setClassName("com.vivo.permissionmanager", "com.vivo.permissionmanager.activity.SoftPermissionDetailActivity");
        if (OsHelper.isIntentAvailable(this.context, intent) && OsHelper.isActivityExported(this.context, intent)) {
            return intent;
        }
        intent.setClassName("com.iqoo.secure", "com.iqoo.secure.safeguard.SoftPermissionDetailActivity");
        if (OsHelper.isIntentAvailable(this.context, intent) && OsHelper.isActivityExported(this.context, intent)) {
            return intent;
        }
        intent.setClassName("com.iqoo.secure", "com.iqoo.secure.MainActivity");
        if (!OsHelper.isIntentAvailable(this.context, intent) || !OsHelper.isActivityExported(this.context, intent)) {
            return null;
        }
        return intent;
    }
}
